<?php

namespace App\Http\Controllers;

use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;

class Controller extends BaseController
{
    use AuthorizesRequests, ValidatesRequests;

    public function success($data, $message = 'OK')
    {
        return ([
            'code'=> 200,
            'message'=> $message,
            'data' => ($data)
        ]);
    }
    public function error( $message = 'error', $code = 400)
    {
        return ([
            'code'=> $code,
            'message'=> $message
        ]);
    }
}
